<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Edit Payment</title>
        <link rel="stylesheet" href="<c:url value="/default.css"/>" type="text/css">
    </head>
    <body>
        <div>
        <h1>Zoznam platieb</h1>

        <table style="margin:0px auto">
            <tr><th>ID</th><th>Odosielateľ</th><th>Príjemca</th><th>Čiastka</th><th>Akce</th></tr>
        <c:forEach items="${payments}" var="payment" varStatus="loopStatus">
            <tr class="${loopStatus.index % 2 == 0 ? 'odd' : 'even'}">
                <td><c:out value="${payment.id}"/></td>
                <td><c:out value="${payment.bankAcc}"/></td>
                <td><c:out value="${payment.destinationAcc}"/></td>
                <td><c:out value="${payment.amount}"/></td>   
                <td><span class="button"><a href="<c:url value="/EditAttributes?id=${payment.id}"/>">upraviť</a></span></td>
            </tr>
        </c:forEach>
        </table>
        <form action="<c:url value="/index.jsp"/>">
            <p>
                <input type="Submit" value="Späť" name="back"/>
            </p>
        </form>
        </div>
    </body>
</html>
